package com.yanmushi.ms.client.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.cache.annotation.CacheKey;
import com.netflix.hystrix.contrib.javanica.cache.annotation.CacheResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author yinlei
 * @Date 2018/4/17
 * @Desc todo
 */
@Service
public class MyDataService {

    @Autowired
    HelloService helloService;

    @HystrixCommand
    @CacheResult
    public String get(@CacheKey Integer id) {
        return helloService.query(id);
    }

}
